#include <REGX52.H>
#include "LCD1602.h"
#include "Key.h"


unsigned int screen[4];
unsigned int a=17;
unsigned int i=0;
unsigned int b=0;
void KeyCheck(unsigned int key[4])
{
	if(key[0]==1&&key[1]==2&&key[2]==3&&key[3]==4)
	{
		LCD_Init();
		Refresh();
		while(1)
		{
			LCD_ShowString(1,1,"Hello World");
			LCD_ShowString(2,1,"New a Day!");
		}
	}
	else
	{
		LCD_Init();
		Refresh();
		while(1)
		{
   		LCD_ShowString(1,1,"Error");
		}
	}
}
void main()
{
	LCD_Init();
	LCD_ShowString(1,1,"key:");
	Start(4);
	while(1)
	{
		if(i==4&&a==16)
		{
			KeyCheck(screen);
		}
		a=Key();
		Check();
		if(a>=0&&a<=9&&i<4)
		{
			screen[i]=a;
			i++;
		}
		else if(a==10)
		{
			i--;
			screen[i]=10;
		}
	}
}
